package whiledemo;

public class whiledemo3 {
    public static void main(String[] args) {
        //while循环生成正方形
        int i =0;
        while (i<=5){
            int j =0;
            while (j<=5){
                System.out.print(" * ");
                j++;
            }
            System.out.println();
            i++;
        }
        //打印正三角
        i=0;
        while (i<=5){
            int j =0;
            while (j<=i){
                System.out.print("* ");
                j++;
            }
            System.out.println();
            i++;
        }
        //打印倒三角
        i = 0;
        while (i<5){
            int j = 0;
            while (j<5-i){
                System.out.print(" * ");
                j++;
            }
            System.out.println();
            i++;
        }
        //打印99乘法表
        i = 1;
        while (i<=9){
            int j =1;
            while (j<=i){
                System.out.print(j + " * "+ i +"= "+j*i +" ");
                j++;
            }
            System.out.println();
            i++;
        }
    }
}
